package com.lagou.xm.io.sqlsession;

import java.sql.SQLException;
import java.util.List;

/**
 * @author XM,Email is huangwei_xm@163.com
 * @ClassName SqlSession
 * @Package com.lagou.xm.io.sqlsession
 * @Description CURD操作
 * @since 2020/9/25 1:23
 * @Copyright: 训练营
 */
public interface SqlSession {

    /**
     * @Description 查询所有的数据
     * @param statementId namespace.id
     * @param params 参数列表
     * @author XM,Email is huangwei_xm@163.com
     * @since 2020/9/25 1:25
     */
    public <E> List<E> selectList(String statementId, Object... params) throws SQLException;

    /**
     * @Description 通过id和名称查询一条记录
     * @param statementId
    * @param params
     * @author XM,Email is huangwei_xm@163.com
     * @since 2020/9/25 1:28
     */
    public <E> E selectOne(String statementId, Object... params) throws SQLException;

    public <T> T getMapper(Class<T> clazz);

}
